/**
 * Copyright 2009 by Christian Scheid. This file is part of the switch eclipse plugin and is licensed under the
 * GPL version 3. Please refer to the URL http://www.gnu.org/licenses/gpl-3.0.html for details.
 */
package org.digitalsoul.switchplugin.matchers;

import org.digitalsoul.switchplugin.model.SwitchFile;

import junit.framework.Assert;
import org.digitalsoul.switchplugin.ProjectBasedTest;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.runtime.CoreException;
import org.junit.Test;



public class PathMatcherTestCase extends ProjectBasedTest {

    private IFile file;

    @Override
    protected void setupFileStructure() throws CoreException {
        IFolder folder = builder.createFolder("src/main/java/org/digitalsoul/switch");
        file = builder.createFile(folder, "ControllerTestCase.java");
    }
    
    @Test
    public void testMatch() {
        SwitchFile switchFile = new SwitchFile(file);
        Assert.assertTrue(new PathMatcher("src/main/java/.*/.*TestCase\\.java").match(switchFile));
    }
}
